<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    /*构造函数名，单词首字母均为大写*/
    function CreatMovie(movieName,type,rate,showTime){
        this.movieName = movieName;
        this.type=type;
        this.rate=rate;
        this.showTime=showTime;
        this.getNextShowing = function(){
            var current = 10;
            for(var i=0;i<this.showTime.length;i++){
                if(current<parseInt(this.showTime[i])){
                    console.log(this.movieName+"下一次的播放时间"+ this.showTime[i]);
                    break;
                }
            }
        }
        return this;
    }

    //对象的实例化过程，需要使用关键字new
    var movie1 = new CreatMovie("007","谍战类","9.0",["12:00","15:00","17:00"]);
    console.log(movie1);
    movie1.getNextShowing();
</script>
</html>